home *** CD-ROM | disk | FTP | other *** search
/ Aminet 1 (Walnut Creek) / Aminet - June 1993 [Walnut Creek].iso / aminet / mus / play / playsid2_1.dms / playsid2_1.adf / Convert64.doc next >
Text File  |  1992-11-26  |  9KB  |  306 lines

  1.  
  2. **************************************************************
  3. ****** HOW TO CONVERT C64 TUNES TO AMIGA PLAYSID FORMAT ******
  4. **************************************************************
  5.  
  6. Requirements:
  7.  
  8.     * You have to know 6502 machinecode quite well.
  9.     * You have access to a C64 or a good Emulator
  10.     * You have an good machine code monitor to your C64 or Emulator
  11.  
  12.     and it will be easier if...
  13.  
  14.     * You have a 1541 diskdrive
  15.     * You have a transfer cable C64-Amiga
  16.     * You have already ripped tunes
  17.     * You know a lot about SID
  18.  
  19. Ripping:
  20.  
  21.     This is often a hard thing to do. You should locate where in
  22.     memory that the musicplayer and data is. If it is spread into
  23.     several parts, then you have to write memory transfer routines.
  24.     You should find where to call to init and start the different
  25.     tunes. You then save the music in one (this is very important) 
  26.     file. You should always try to locate as many tunes or sounds
  27.     as possible, so that nothing is forgotten. Otherwise your job
  28.     maybe will be re-done by another guy who has found more tunes.
  29.  
  30. Converting:
  31.  
  32.     This is easier. If you have already ripped tunes that consists
  33.     of more than one file, see instructions on ripping. Now you 
  34.     should rewrite the music player so that it can be thought of as
  35.     two major subroutines (sometimes this is already the case, like
  36.     Maniacs of Noise). The first subroutine will be called by PlaySID
  37.     with the accumulator set to the tunenumber (hex $00-$FF). This
  38.     should initalize all things like volume etc. The second subroutine
  39.     is the real music playing part. This will be called by PlaySID
  40.     each 1/50 or 1/60 second (set by parameters in .info). Note that
  41.     this routine routine should be ended by either RTI, RTS or a jump
  42.     to address $Exxx (this because the non-used bytes at $E000-FFFF is
  43.     filled with $40=RTI). If you use RTS you must then also check that
  44.     the stackpointer is ok (the same as when called from PlaySID).
  45.     Note that the memory transfer routines should be in the first
  46.     subroutine. Note also that PlaySID initializes all 64k of memory and
  47.     reloads the musicplayer each time you press play. Note also that
  48.     the memory control register ($01) is of nearly no use under PlaySID.
  49.     It sees all memory as ram (even $D000-$DFFF!).
  50.  
  51.     Sometimes the music uses the fourth channel, like sample channel.
  52.     This is done by changing the volume ($D418) very often. Usually
  53.     this is programmed using the NMI ($0318 or $FFFA). PlaySID uses
  54.     another metod. The SID registers are enhanced with several new
  55.     registers, see below. You have to write a routine that is a part
  56.     of the second subroutine. This routine replaces the NMI routine,
  57.     and with that follows that the NMI routine are not used anymore. For
  58.     some examples look below (although they're not NMI's but they'll
  59.     explain the way to convert). Please always write to the START reg
  60.     ($D41D) after you have set the other regs, for future revisions
  61.     of PlaySID.
  62.  
  63. Transfering:
  64.  
  65.     When you transfer the files, you don't have to remove the
  66.     2 bytes in the beginning of the file (if you let them be, you
  67.     could also use the files in some C64emulator that maybe will be
  68.     released). If you haven't got the opportunity to transfer by
  69.     yourself, you could send the files to us (the authors of PlaySID)
  70.     on a 5 1/4 disk or even cassette. If you do, the you must 
  71.     include the information about the .info parameters.
  72.  
  73. Making the Icon:
  74.  
  75.     Just copy an icon from an existing PlaySID file. For example
  76.     copy arkanoid.info to <filename>.info. Then select the icon in
  77.     workbench and select Information in the workbench menu. Now you
  78.     change the parameters to that of your file. Look at PlaySID.doc
  79.     for a complete description of the parameters. It is very much
  80.     appreciated that you also include information about author and
  81.     copyright. You could even include lines like RIPPER="xxxx" or
  82.     VERSION="xxxxx", because these lines are not seen by PLAYSID.
  83.  
  84. Appendix:
  85.  
  86. *********************
  87. * NEW SID REGISTERS *
  88. *********************
  89.  
  90.     ADDRESS    VALUE    FUNCTION            USAGE
  91.  
  92.     D41D    00-FC    Nr of tones-1            Galway-Noise (START)
  93.         FD    Stop Sampling            Sample (STOP)
  94.         FC    Start Sampling with 1/4        Sample (START)
  95.             volume
  96.         FE    Start Sampling with 1/2        Sample (START)
  97.             volume
  98.         FF    Start Sampling            Sample (START)
  99.  
  100.     D41E    00-FF    ToneData address lowbyte    Galway-Noise
  101.     D41F    00-FF    ToneData address highbyte    Galway-Noise
  102.     D41E    00-FF    SampleData address low        Sample
  103.     D41F    00-FF    SampleData address high        Sample
  104.  
  105.     D43D    00-FF    Tonelength (in samples)        Galway-Noise
  106.     D43E    00-0F    Volume of Noise            Galway-Noise
  107.     D43D    00-FF    SampleData end addr. low    Sample
  108.     D43E    00-FF    SampleData end addr. high    Sample
  109.  
  110.     D43F    00-FF    Period for each value of    Galway-Noise
  111.             ToneData (in C64-cycles)
  112.         00-FE    Nr times of Repeat        Sample
  113.         FF    Continious sample        Sample
  114.  
  115.     D45D    00-FF    Period for value 0 of        Galway-Noise
  116.             ToneData (in C64-cycles)
  117.         00-FF    Period for samples lowbyte    Sample
  118.     D45E    00-FF    Period for samples highbyte    Sample
  119.             (in C64-cycles)
  120.  
  121.     D45F    00,01    Nr of bytes to add after    Sample
  122.         02,04    Reading one nibble (4 bits)
  123.         08...    (i.e. Octave) ,usually 00
  124.  
  125.     D47D    00    Sampleorder: Lownibble        Sample
  126.             ,Highnibble (the most used)
  127.         01    Sampleorder: Highnibble        Sample
  128.             ,Lownibble
  129.  
  130.     D47E    00-FF    SampleData repeatadd low    Sample
  131.     D47F    00-FF    SampleData repeatadd high    Sample
  132.  
  133.  
  134. * EXAMPLES *
  135. ; *** MARTIN GALWAY *** *** NOISE ***
  136. ; 6502 Routine:
  137. ; Loop of Y=5 to 0 step -1
  138. ; Loop of X=19 to 0 step -1
  139. ; Read $B64E,Y in A
  140. ; Wait A*73 cycles
  141. ; Wait 22 cycles
  142. ; Add 7 to volume
  143. ; End Loop X
  144. ; End Loop Y
  145. ; END
  146. ;
  147. ; Replacement with:
  148. ; D41D=$05
  149. ; D43D=$19
  150. ; D41E=$4E, D41F=$B6
  151. ; D43F=$73
  152. ; D45D=$22
  153. ; D43E=$07
  154. ;
  155. ; *** MARTIN GALWAY *** *** SAMPLE ***
  156. ; 6502 Routine:
  157. ; Loop of Y=0 to 100 step 1
  158. ; Read $B64E,Y in A
  159. ; Write Lownibble of A in Volumereg
  160. ; Wait 74 cycles
  161. ; Write Highnibble of A in Volumereg
  162. ; Wait 74 cycles
  163. ; End Loop Y
  164. ; Do it one more time
  165. ; END
  166. ;
  167. ; Replacement with:
  168. ; D41D=$FF
  169. ; D41E=$4E, D41F=$B6
  170. ; D43D=$4E, D43E=$B7
  171. ; D45D=$74, D45E=$00
  172. ; D45F=$00
  173. ; D47D=$00
  174. ; D43F=$01
  175. ; D47E=$4E, D47F=$B6
  176. ;
  177. ;
  178.  
  179. ***********************************
  180. * UNIMPLEMENTED 6502 INSTRUCTIONS *
  181. ***********************************
  182.  
  183. Complete list of the unimplemented instructions for the 6510 microprocessor.
  184. (C) 1984,1992 Håkan Sundell
  185.  
  186. Notes: In the listing belove there are some shortcuts used, A = Accumulator
  187.        , X = Index register X , Y = Index register Y , SP = Stackpointer
  188.        , M = byte in Memory , -> = is Stored in. The flag settings are,
  189.        unless other specified, calculated in the same way as the consisting
  190.        intructions.
  191.  
  192. Code    Adress-mode    Description
  193. 02    ---        Total HALT
  194. 03    (Ind,X)        ASL,ORA
  195. 04    Zeropage    NOP
  196. 07    Zeropage    ASL,ORA
  197. 0B    Immediate    AND #$xx,ASL A with only setting flags
  198. 0C    Absolute    NOP
  199. 0F    Absolute    ASL,ORA
  200. 12    ---        Total HALT
  201. 13    (Ind),Y        ASL,ORA
  202. 14    Zeropage    NOP
  203. 17    Zeropage,X    ASL,ORA
  204. 1A    Implied        NOP
  205. 1B    Absolute,Y    ASL,ORA
  206. 1C    Absolute    NOP
  207. 1F    Absolute,X    ASL,ORA
  208.  
  209. 22    ---        Total HALT
  210. 23    (Ind,X)        ROL,AND
  211. 27    Zeropage    ROL,AND
  212. 2B    Immediate    AND #$xx,ROL A with only setting flags
  213. 2F    Absolute    ROL,AND
  214. 32    ---        Total HALT
  215. 33    (Ind),Y        ROL,AND
  216. 34    Zeropage    NOP
  217. 37    Zeropage,X    ROL,AND
  218. 3A    Implied        NOP
  219. 3B    Absolute,Y    ROL,AND
  220. 3C    Absolute    NOP
  221. 3F    Absolute,X    ROL,AND
  222.  
  223. 42    ---        Total HALT
  224. 43    (Ind,X)        LSR,EOR
  225. 44    Zeropage    NOP
  226. 47    Zeropage    LSR,EOR
  227. 4B    Immediate    AND #$xx,LSR A
  228. 4F    Absolute    LSR,EOR
  229. 52    ---        Total HALT
  230. 53    (Ind,Y)        LSR,EOR
  231. 54    Zeropage    NOP
  232. 57    Zeropage,X    LSR,EOR
  233. 5A    Implied        NOP
  234. 5B    Absolute,Y    LSR,EOR
  235. 5C    Absolute    NOP
  236. 5F    Absoulte,X    LSR,EOR
  237.  
  238. 62    ---        Total HALT
  239. 63    (Ind,X)        ROR,ADC
  240. 64    Zeropage    NOP
  241. 67    Zeropage    ROR,ADC
  242. 6B    Immediate    AND #$xx,ROR A
  243. 6F    Absoulte    ROR,ADC
  244. 72    ---        Total HALT
  245. 73    (Ind),Y        ROR,ADC
  246. 74    Zeropage    NOP
  247. 77    Zeropage,X    ROR,ADC
  248. 7A    Implied        NOP
  249. 7B    Absolute,Y    ROR,ADC
  250. 7C    Absolute    NOP
  251. 7F    Absolute,X    ROR,ADC
  252.  
  253. 80    Zeropage    NOP
  254. 82    Zeropage    NOP
  255. 83    (Ind,X)        0->M if X=0 , No flags set
  256. 87    Zeropage    A and X -> M , No flags set
  257. 8B    Immediate    M and X -> A (bits 7-1) , M0 and X0 and A0 -> A0
  258.                         , No flags set
  259. 8F    Absolute    A and X -> M , No flags set
  260. 92    ---        Total HALT
  261. 93    (Ind),Y        A and X and $21 -> M , No flags set
  262. 97    Zeropage,Y    A and X -> M , No flags set
  263. 9B    Absolute,Y    A and X and $21 -> M , A and X -> SP, No flags set
  264. 9C    Absolute,X    A and Y and $21 -> M , No flags set
  265. 9E    Absolute,Y    A and X and $21 -> M , No flags set
  266. 9F    Absolute,Y    A and X and $21 -> M , No flags set
  267.  
  268. A3    (Ind,X)        LDA,LDX
  269. A7    Zeropage    LDA,LDX
  270. AB    Immediate    LDA,LDX
  271. AF    Absolute    LDA,LDX
  272. B2    ---        Total HALT
  273. B3    (Ind),Y        LDA,LDX
  274. B7    Zeropage,Y    LDA,LDX
  275. BB    Absolute,Y    SP and M -> A,X,SP
  276. BF    Absolute,Y    LDA,LDX
  277.  
  278. C2    Zeropage    NOP
  279. C3    (Ind,X)        DEC,CMP
  280. C7    Zeropage    DEC,CMP
  281. CB    Immediate    (X and A) - M -> X
  282. CF    Absolute    DEC,CMP
  283. D2    ---        Total HALT
  284. D3    (Ind),Y        DEC,CMP
  285. D4    Zeropage    NOP
  286. D7    Zeropage,X    DEC,CMP
  287. DA    Implied        NOP
  288. DB    Absolute,Y    DEC,CMP
  289. DC    Absolute    NOP
  290. DF    Absolute,X    DEC,CMP
  291.  
  292. E2    Zeropage    NOP
  293. E3    (Ind,X)        INC,SBC
  294. E7    Zeropage    INC,SBC
  295. EB    Immedite    SBC #$xx
  296. EF    Absolute    INC,SBC
  297. F2    ---        Total HALT
  298. F3    (Ind),Y        INC,SBC
  299. F4    Zeropage    NOP
  300. F7    Zeropage,X    INC,SBC
  301. FA    Implied        NOP
  302. FB    Absolute,Y    INC,SBC
  303. FC    Absolute    NOP
  304. FF    Absolute,X    INC,SBC
  305.  
  306.